﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SoundServant.Controls
{
    /// <summary>
    /// Interaction logic for NavTab.xaml
    /// </summary>
    public partial class DiscChooserControl : UserControl
    {

        private StoredDisc disc;
        public StoredDisc Disc { get { return disc; } }
        public bool IsChecked { get { return ((bool)DiscCheckBox.IsChecked); } }

        public DiscChooserControl(StoredDisc _disc)
        {
            InitializeComponent();

            disc = _disc;
            DiscNumLabel.Content = "Disc " + disc.Number + " (" + SS.ParseTimeSpan(disc.Length) + ")";
            DiscTitleLabel.Text = disc.Title;

            if (disc.Current) DiscTitleLabel.Text += " (current)";

        }

        private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (!disc.Current) DiscCheckBox.IsChecked = !(bool)DiscCheckBox.IsChecked;
        }

        private void DiscCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            if (disc.Current) DiscCheckBox.IsChecked = false;
        }




    }
}
